/*
 *  Class name: PlayerDetailDTO.java
 *  Version: 1.0
 *  Date: 21.12.2013
 */
package cz.muni.fi.pa165.soccergamesarchive.businesslayer.dtos;

import java.util.List;
import java.util.Objects;

/**
 *
 * @author Michal Ďuriš
 */
public class PlayerDetailDTO {

    private Long id;

    private String name;

    private String teamName;

    private int shirtNumber;

    private Long scoredGoals;

    private List<SoccerMatchDTO> soccerMatches;

    public PlayerDetailDTO(String firstName, String lastName,
                           String teamName, int shirtNumber,
                           Long scoredGoals) {
        name = firstName + " " + lastName;
        this.teamName = teamName;
        this.shirtNumber = shirtNumber;
        this.scoredGoals = scoredGoals;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    public int getShirtNumber() {
        return shirtNumber;
    }

    public void setShirtNumber(int shirtNumber) {
        this.shirtNumber = shirtNumber;
    }

    public Long getScoredGoals() {
        return scoredGoals;
    }

    public void setScoredGoals(Long scoredGoals) {
        this.scoredGoals = scoredGoals;
    }

    public List<SoccerMatchDTO> getSoccerMatches() {
        return soccerMatches;
    }

    public void setSoccerMatches(List<SoccerMatchDTO> soccerMatches) {
        this.soccerMatches = soccerMatches;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 31 * hash + this.shirtNumber;
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final PlayerDetailDTO other = (PlayerDetailDTO) obj;

        if (this.shirtNumber != other.shirtNumber) {
            return false;
        }

        if (!Objects.equals(this.name, other.name)) {
            return false;
        }

        if (!Objects.equals(this.teamName, other.teamName)) {
            return false;
        }
        return Objects.equals(this.scoredGoals, other.scoredGoals);
    }

    @Override
    public String toString() {
        return "PlayerDetailDTO{" + "name=" + name + ", teamName=" + teamName
                + ", scoredGoals=" + scoredGoals + '}';
    }

}
